home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / cppcom.zip / CHARQUEU.HPP < prev    next >
C/C++ Source or Header  |  1991-04-14  |  2KB  |  51 lines

  1. /***************************************************************************
  2. These C++ classes are copyright 1990, by William Herrera.
  3. All those who put this code or its derivatives in a commercial product MUST
  4. mention this copyright in their documentation for users of the products in
  5. which this code or its derivative classes are used.  Otherwise, this code
  6. may be freely distributed and freely used for any purpose.
  7.  
  8. Enhancements: 1991 by David Orme
  9.     *  General cleanup.
  10.             - I/O now takes advantage of C++ overloading.
  11.             - Serial port I/O functionality now only in Serial class.
  12.             - Modem functionality now only in Modem class.
  13.     *  Possible to easily implement file Xfr prots now.
  14.     *  CCITT CRC-16 class added                            -- 2-20-1991
  15.     *  BIOS Timer class added                                -- 2-22-1991
  16.     *  Optional timeout on all input routines added    -- 2-25-1991
  17.  
  18. ***************************************************************************/
  19.  
  20. // file charqueu.hpp class declaration for the CharQueue class.
  21.  
  22. #ifndef CHARQUEU_HPP
  23. #define CHARQUEU_HPP 1
  24.  
  25. #include <bool.h>    // enum boolean { false, true }; if you don't have
  26.  
  27. class CharQueue 
  28. {
  29. protected:
  30.     char * queue_buffer;
  31.     unsigned int size;
  32.     unsigned int count;
  33.     unsigned int add_position;
  34.     unsigned int get_position;
  35. public:
  36.     CharQueue(unsigned int bufsize = 1000);
  37.     ~CharQueue();
  38.     int Add(char ch);
  39.     int Get();
  40.     int Peek();
  41.     void Purge();
  42.     unsigned int GetCount();
  43.     boolean IsFull();
  44.     boolean IsEmpty();
  45. };
  46.  
  47. #endif
  48.  
  49. // end of file CharQueu.hpp
  50.  
  51.